package com.glela.goods.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.glela.goods.model.GoodsComment;


public interface GoodsCommentMapper {

	/**
	 * 根据商品id查询 评论列表
	 * 
	 * @param pagelimit
	 * @param pageSize
	 * @param goodId
	 * @return
	 */
	public List<GoodsComment> selectGoodsCommentByGoodId(@Param("pagelimit") int pagelimit,
			@Param("pageSize") int pageSize, @Param("goodId") long goodId);

	/**
	 * 根据商品id查询评论数
	 * 
	 * @param goodId
	 * @return
	 */
	public int selectGoodsCommentByGoodIdCount(long goodId);

	/**
	 * 添加商品评论
	 * 
	 * @param goodId
	 * @param userId
	 * @param commentText
	 * @param image1
	 * @param image2
	 * @param image3
	 * @return
	 */
	public int insertGoodsComment(@Param("goodId") long goodId, @Param("userId") long userId,
			@Param("commentText") String commentText, @Param("image1") String image1, @Param("image2") String image2,
			@Param("image3") String image3, @Param("specName") String specName, @Param("orderDetailId") Long orderDetailId);

	public void updateGoodsCommentCloseByOrderDetailId(Long orderDetailId);
}
